package com.maxatime.web.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.maxatime.common.constant.BusinessContents;
import com.maxatime.pojo.dto.MenuDTO;
import com.maxatime.service.MenuService;

@RequestMapping("/menu")
@Controller
public class MenuController {
	
	// 日志
	private Logger log = LogManager.getLogger();
		
	@Autowired
	MenuService menuService;
	
	@RequestMapping("/Menu")
	@ResponseBody
	public Map<String, Object> Menu() {
		
		//返回值
		Map<String, Object> m = new HashMap<>();
		
		Map<String, Object> resultMap = null;
		List<MenuDTO> listMenu = menuService.listMenu();
		m.put(BusinessContents.CODE, "0000");
		m.put(BusinessContents.MSG, "交易成功");
		m.put(BusinessContents.DATA, listMenu);
		return m;
	}
}
